//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.lyq.bean.mySql;

import com.lyq.bean.Manager;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.List;

public class SeekAllM_Sql {
    public SeekAllM_Sql() {
    }

    public List<Manager> seekAllM_Sql(List<Manager> list) {
        (new MysqlLinking()).getLink();
        Connection conn = MysqlLinking.conn;
        if (conn != null) {
            try {
                String sql = "select * from manager ";
                PreparedStatement ps = conn.prepareStatement(sql);
                ResultSet rs = ps.executeQuery();

                while(rs.next()) {
                    Manager m = new Manager();
                    m.setName(rs.getString("M_Name"));
                    m.setPwd(rs.getString("M_Pwd"));
                    list.add(m);
                }

                rs.close();
                ps.close();
            } catch (Exception var7) {
                Exception e = var7;
                e.printStackTrace();
            }
        } else {
            System.out.println("数据库连接错误！");
        }

        return list;
    }
}